#define _CRT_SECURE_NO_WARNINGS 1
#include<iostream>
#include<vector>

using namespace std;

//int numDecodings(string s) {
//    int m = s.size(), sum = 0;
//    vector<int> dp(m + 1, 0);
//    if (s[0] == '0') return 0;
//    dp[1] = 1;
//    for (int i = 1; i < m; ++i) {
//        if (s[i] >= '1' && s[i] <= '9') dp[i + 1] += dp[i];
//        if (% >= 1 && (s[i - 1] - '0') * 10 + (s[i] - '0') <= 26) dp[i + 1] += dp[i - 1];
//        if (dp[i + 1] == 0) return 0;
//    }
//    return dp[m];
//}
//
//int main() {
//	string s{ "12" };
//    cout << numDecodings(s);
//
//	return 0;
//}


int minChanges(int n, int k) {
    int res = 0;
    while (n != 0 || k != 0) {
        if (n & 1 == 0 && k & 1 == 1) return -1;
        else if (n & 1 == 1 && k & 1 == 0) ++res;
        n >>= 1;
        k >>= 1;
    }
    return res;
}

int uniquePathsWithObstacles(vector<vector<int>>& obstacleGrid) {
    int m = obstacleGrid.size(), n = obstacleGrid[0].size();
    vector<vector<long long>> dp(m + 1, vector<long long>(n + 1, 0));
    dp[0][1] = 1;
    for (int i = 1; i <= m; ++i) {
        for (int j = 1; j <= n; ++j) {
            if (obstacleGrid[i][j] == 0)
                dp[i][j] = dp[i - 1][j] + dp[i][j - 1];
        }
    }
    return dp[m][n];
}

int main() {
    vector<vector<int>> num{ {0,0,0},{0,1,0},{0,0,0} };
    cout << uniquePathsWithObstacles(num);
}